<?php

/**
 * LigneBonLivraisonFournesser filter form base class.
 *
 * @package    SdCommerce
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseLigneBonLivraisonFournesserFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'designation'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'taux_remise'                  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'quantite_livre'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'quantite'                     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'poids_net'                    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'poids_brut'                   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_unitaire_ht'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_total_ht'                => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_total_ttc'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_total_ttcnet'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'prix_tva'                     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'stock_article_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('StockArticle'), 'add_empty' => true)),
      'article_serie_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ArticleSerie'), 'add_empty' => true)),
      'bon_livraison_fournesseur_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BonLivraisonFournisseur'), 'add_empty' => true)),
      'tva_id'                       => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Tva'), 'add_empty' => true)),
      'maintenance_id'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Maintenance'), 'add_empty' => true)),
      'departement_id'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Departement'), 'add_empty' => true)),
      'unite_logistique_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UniteLogistique'), 'add_empty' => true)),
      'r'                            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'q'                            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'created_at'                   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'                   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'deleted_at'                   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
    ));

    $this->setValidators(array(
      'designation'                  => new sfValidatorPass(array('required' => false)),
      'taux_remise'                  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'quantite_livre'               => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'quantite'                     => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'poids_net'                    => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'poids_brut'                   => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_unitaire_ht'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_total_ht'                => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_total_ttc'               => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_total_ttcnet'            => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'prix_tva'                     => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stock_article_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('StockArticle'), 'column' => 'id')),
      'article_serie_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('ArticleSerie'), 'column' => 'id')),
      'bon_livraison_fournesseur_id' => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('BonLivraisonFournisseur'), 'column' => 'id')),
      'tva_id'                       => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Tva'), 'column' => 'id')),
      'maintenance_id'               => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Maintenance'), 'column' => 'id')),
      'departement_id'               => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Departement'), 'column' => 'id')),
      'unite_logistique_id'          => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('UniteLogistique'), 'column' => 'id')),
      'r'                            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'q'                            => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'created_at'                   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'                   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'deleted_at'                   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('ligne_bon_livraison_fournesser_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LigneBonLivraisonFournesser';
  }

  public function getFields()
  {
    return array(
      'id'                           => 'Number',
      'designation'                  => 'Text',
      'taux_remise'                  => 'Number',
      'quantite_livre'               => 'Number',
      'quantite'                     => 'Number',
      'poids_net'                    => 'Number',
      'poids_brut'                   => 'Number',
      'prix_unitaire_ht'             => 'Number',
      'prix_total_ht'                => 'Number',
      'prix_total_ttc'               => 'Number',
      'prix_total_ttcnet'            => 'Number',
      'prix_tva'                     => 'Number',
      'stock_article_id'             => 'ForeignKey',
      'article_serie_id'             => 'ForeignKey',
      'bon_livraison_fournesseur_id' => 'ForeignKey',
      'tva_id'                       => 'ForeignKey',
      'maintenance_id'               => 'ForeignKey',
      'departement_id'               => 'ForeignKey',
      'unite_logistique_id'          => 'ForeignKey',
      'r'                            => 'Number',
      'q'                            => 'Number',
      'created_at'                   => 'Date',
      'updated_at'                   => 'Date',
      'deleted_at'                   => 'Date',
    );
  }
}
